Add dialog for mismatched GPSBabel versions, nagware dialog, Mac UI fixes.
authorrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Sat, 19 Jun 2010 23:59:06 +0000 (23:59 +0000)
committerrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Sat, 19 Jun 2010 23:59:06 +0000 (23:59 +0000)
14 files changed:
gpsbabel/gui/app.pro
gpsbabel/gui/babeldata.h
gpsbabel/gui/donate.cpp [new file with mode: 0644]
gpsbabel/gui/donate.h [new file with mode: 0644]
gpsbabel/gui/donate.ui [new file with mode: 0644]
gpsbabel/gui/gpsbabelfe_es.qm
gpsbabel/gui/gpsbabelfe_it.qm
gpsbabel/gui/mainwindow.cpp
gpsbabel/gui/preferences.cpp
gpsbabel/gui/preferences.ui
gpsbabel/gui/upgrade.cpp
gpsbabel/gui/version_mismatch.cpp [new file with mode: 0644]
gpsbabel/gui/version_mismatch.h [new file with mode: 0644]
gpsbabel/gui/version_mismatch.ui [new file with mode: 0644]

index f7a06c2343c35aa030126789907f4e67c7f3de7f..57a781e6e8791b3ed2aa23b19a2cc5701cf62345 100755 (executable)
@@ -1,4 +1,4 @@
-# $Id: app.pro,v 1.17 2010-06-03 15:01:24 robertl Exp $
+# $Id: app.pro,v 1.18 2010-06-19 23:59:06 robertl Exp $
 #
 
 CONFIG += qt release 
@@ -11,7 +11,7 @@ ICON = images/appicon.icns
 
 QT += network \
     xml \
-    webkit
+    webkit \
 
 unix:DESTDIR = objects
 unix:MOC_DIR = objects
@@ -25,12 +25,13 @@ UI_DIR = tmp
 RESOURCES = app.qrc 
 RC_FILE = app.rc
 
-mac:TARGET=GPSBabelFE
 win32:TARGET=GPSBabelFE
 unix:TARGET=gpsbabelfe-bin
+mac:TARGET=GPSBabelFE
 
 FORMS += aboutui.ui
 FORMS += advui.ui
+FORMS += donate.ui
 FORMS += filterui.ui
 FORMS += gmapui.ui
 FORMS += mainwinui.ui
@@ -39,10 +40,12 @@ FORMS += preferences.ui
 FORMS += rttrkui.ui
 FORMS += trackui.ui
 FORMS += upgrade.ui
+FORMS += version_mismatch.ui
 FORMS += wayptsui.ui
 
 SOURCES += aboutdlg.cpp
 SOURCES += advdlg.cpp
+SOURCES += donate.cpp
 SOURCES += dpencode.cpp
 SOURCES += filterdata.cpp
 SOURCES += filterdlg.cpp
@@ -60,6 +63,7 @@ SOURCES += optionsdlg.cpp
 SOURCES += preferences.cpp
 SOURCES += processwait.cpp
 SOURCES += upgrade.cpp
+SOURCES += version_mismatch.cpp
 macx:SOURCES += serial_mac.cpp
 unix:SOURCES += serial_unix.cpp
 windows:SOURCES += serial_win.cpp
@@ -68,6 +72,7 @@ HEADERS += aboutdlg.h
 HEADERS += advdlg.h
 HEADERS += appname.h
 HEADERS += babeldata.h
+HEADERS += donate.h
 HEADERS += filterdata.h
 HEADERS += filterdlg.h
 HEADERS += filterwidgets.h
@@ -83,6 +88,7 @@ HEADERS += preferences.h
 HEADERS += processwait.h
 HEADERS += setting.h
 HEADERS += upgrade.h
+HEADERS += version_mismatch.h
 
 TRANSLATIONS += gpsbabelfe_ru.ts
 TRANSLATIONS += gpsbabelfe_de.ts
index 983d39f454e40c32192943b234c77c80ea2df140..b237dfcd029cf070d6f60aa23a800a07d6f9ce6f 100644 (file)
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-// $Id: babeldata.h,v 1.7 2010-04-12 02:53:04 robertl Exp $
+// $Id: babeldata.h,v 1.8 2010-06-19 23:59:06 robertl Exp $
 //------------------------------------------------------------------------
 //
 //  Copyright (C) 2009  S. Khai Mong <khai@mangrai.com>.
@@ -58,12 +58,17 @@ public:
     upgradeCheckTime(QDateTime(QDate(2001, 1, 1), QTime(0, 0))),
     installationUuid(QUuid::createUuid().toString()),
     upgradeCallbacks(0),
+    upgradeAccept(0),
     upgradeDeclines(0),
     upgradeErrors(0),
     upgradeOffers(0),
+    runCount(0),
     startupVersionCheck(true),
     reportStatistics(true),
-    allowBetaUpgrades(false)
+    allowBetaUpgrades(false),
+    ignoreVersionMismatch(false),
+    disableDonateDialog(false),
+    donateSplashed(QDateTime(QDate(2010, 1, 1), QTime(0, 0, 0)))
   {
   };
   
@@ -105,16 +110,21 @@ public:
     sg.addVarSetting(new BoolSetting("app.previewGmap", previewGmap));
     sg.addVarSetting(new IntSetting("app.upgradeCheckMethod", upgradeCheckMethod));
     sg.addVarSetting(new DateTimeSetting("app.upgradeCheckTime", upgradeCheckTime));
+    sg.addVarSetting(new DateTimeSetting("app.donateSplashed", donateSplashed));
     sg.addVarSetting(new StringSetting("app.installationUuid", installationUuid));
     sg.addVarSetting(new IntSetting("app.upgradeCallbacks", upgradeCallbacks));
+    sg.addVarSetting(new IntSetting("app.upgradeAccept", upgradeAccept));
     sg.addVarSetting(new IntSetting("app.upgradeDeclines", upgradeDeclines));
     sg.addVarSetting(new IntSetting("app.upgradeErrors", upgradeErrors));
     sg.addVarSetting(new IntSetting("app.upgradeOffers", upgradeOffers));
+    sg.addVarSetting(new IntSetting("app.runCount", runCount));
 
     // Global preferences.
     sg.addVarSetting(new BoolSetting("app.startupVersionCheck", startupVersionCheck));
     sg.addVarSetting(new BoolSetting("app.reportStatistics", reportStatistics));
     sg.addVarSetting(new BoolSetting("app.allowBetaUpgrades", allowBetaUpgrades));
+    sg.addVarSetting(new BoolSetting("app.ignoreVersionMismatch", ignoreVersionMismatch));
+    sg.addVarSetting(new BoolSetting("app.disableDonateDialog", disableDonateDialog));
 
   }
 
@@ -152,14 +162,19 @@ public:
   QDateTime upgradeCheckTime;
   QString installationUuid;
   int upgradeCallbacks;
+  int upgradeAccept;
   int upgradeDeclines;
   int upgradeErrors;
   int upgradeOffers;
+  int runCount;
 
   // Global preferences.
   bool startupVersionCheck;
   bool reportStatistics;
   bool allowBetaUpgrades;
+  bool ignoreVersionMismatch;
+  bool disableDonateDialog;
+  QDateTime donateSplashed;
 
 };
 
diff --git a/gpsbabel/gui/donate.cpp b/gpsbabel/gui/donate.cpp
new file mode 100644 (file)
index 0000000..970c8bf
--- /dev/null
@@ -0,0 +1,37 @@
+// -*- C++ -*-
+//------------------------------------------------------------------------
+//
+//  Copyright (C) 2010  Robert Lipe <robertlipe@gpsbabel.org
+//
+//  This program is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU General Public License as
+//  published by the Free Software Foundation; either version 2 of the
+//  License, or (at your option) any later version.
+//
+//  This program is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  General Public License for more details.
+//
+//  You should have received a copy of the GNU General Public License
+//  along with this program; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111
+//  USA
+//
+
+#include "donate.h"
+#include <QUrl>
+#include <QDesktopServices>
+
+// A completely simple QDialog, in a class of its own for layout.
+Donate::Donate(QWidget *parent) : QDialog(parent)
+{
+  ui.setupUi(this);
+  connect(ui.contributeButton, SIGNAL(clicked()), this, SLOT(contributeClicked()));
+}
+
+void Donate::contributeClicked()
+{
+  QDesktopServices::openUrl(QUrl("http://www.gpsbabel.org/contribute.html"));
+  close();
+}
diff --git a/gpsbabel/gui/donate.h b/gpsbabel/gui/donate.h
new file mode 100644 (file)
index 0000000..0b6ae2b
--- /dev/null
@@ -0,0 +1,46 @@
+// -*- C++ -*-
+//------------------------------------------------------------------------
+//
+//  Copyright (C) 2010  Robert Lipe <robertlipe@gpsbabel.org>
+//
+//  This program is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU General Public License as
+//  published by the Free Software Foundation; either version 2 of the
+//  License, or (at your option) any later version.
+//
+//  This program is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  General Public License for more details.
+//
+//  You should have received a copy of the GNU General Public License
+//  along with this program; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111
+//  USA
+//
+
+#ifndef DONATE_H
+#define DONATE_H
+
+#include "ui_donate.h"
+
+class Donate: public QDialog {
+ Q_OBJECT
+
+ public:
+  Donate(QWidget *parent);
+  void showNever(bool f)  { 
+    ui.neverAgain->setVisible(f); 
+    ui.textLine2->setVisible(f); 
+  }
+  bool neverAgain() { return ui.neverAgain->isChecked(); }
+
+ private:
+  Ui_Donate  ui;
+
+ private slots:
+  void contributeClicked();
+
+};
+
+#endif
diff --git a/gpsbabel/gui/donate.ui b/gpsbabel/gui/donate.ui
new file mode 100644 (file)
index 0000000..2fae6ea
--- /dev/null
@@ -0,0 +1,134 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>Donate</class>
+ <widget class="QDialog" name="Donate">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>351</width>
+    <height>300</height>
+   </rect>
+  </property>
+  <property name="sizePolicy">
+   <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+    <horstretch>0</horstretch>
+    <verstretch>0</verstretch>
+   </sizepolicy>
+  </property>
+  <property name="minimumSize">
+   <size>
+    <width>0</width>
+    <height>0</height>
+   </size>
+  </property>
+  <property name="maximumSize">
+   <size>
+    <width>400</width>
+    <height>300</height>
+   </size>
+  </property>
+  <property name="windowTitle">
+   <string>Support GPSBabel</string>
+  </property>
+  <widget class="QWidget" name="layoutWidget">
+   <property name="geometry">
+    <rect>
+     <x>10</x>
+     <y>13</y>
+     <width>312</width>
+     <height>249</height>
+    </rect>
+   </property>
+   <layout class="QVBoxLayout" name="verticalLayout">
+    <item>
+     <widget class="QLabel" name="textLine1">
+      <property name="text">
+       <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
+&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
+p, li { white-space: pre-wrap; }
+&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Lucida Grande'; font-size:13pt; font-weight:400; font-style:normal;&quot;&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;GPSBabel is free software built and supported by volunteers. It consumes vast amounts of time to create and support the software as well as money for mapping programs, GPS receivers, and development fixtures. Please see how you can &lt;a href=&quot;http://www.gpsbabel.org&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;contribute time or via PayPal (no account needed) or Google Checkout.&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+      </property>
+      <property name="wordWrap">
+       <bool>true</bool>
+      </property>
+     </widget>
+    </item>
+    <item>
+     <widget class="QLabel" name="textLine2">
+      <property name="text">
+       <string>&lt;p&gt;Of course, if you've already contributed  to the project or you just can't help the project, please check the box below to never see this message again.&lt;/p&gt;</string>
+      </property>
+      <property name="wordWrap">
+       <bool>true</bool>
+      </property>
+     </widget>
+    </item>
+    <item>
+     <widget class="QCheckBox" name="neverAgain">
+      <property name="text">
+       <string>Never show this message again.</string>
+      </property>
+     </widget>
+    </item>
+    <item>
+     <layout class="QHBoxLayout" name="horizontalLayout">
+      <item>
+       <spacer name="horizontalSpacer">
+        <property name="orientation">
+         <enum>Qt::Horizontal</enum>
+        </property>
+        <property name="sizeHint" stdset="0">
+         <size>
+          <width>40</width>
+          <height>20</height>
+         </size>
+        </property>
+       </spacer>
+      </item>
+      <item>
+       <widget class="QPushButton" name="dismissButton">
+        <property name="text">
+         <string>No, Thanks</string>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <widget class="QPushButton" name="contributeButton">
+        <property name="text">
+         <string>Contribute</string>
+        </property>
+        <property name="autoDefault">
+         <bool>false</bool>
+        </property>
+        <property name="default">
+         <bool>true</bool>
+        </property>
+       </widget>
+      </item>
+     </layout>
+    </item>
+   </layout>
+  </widget>
+ </widget>
+ <resources/>
+ <connections>
+  <connection>
+   <sender>dismissButton</sender>
+   <signal>clicked()</signal>
+   <receiver>Donate</receiver>
+   <slot>close()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>139</x>
+     <y>247</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>198</x>
+     <y>141</y>
+    </hint>
+   </hints>
+  </connection>
+ </connections>
+</ui>
index 265473a05c50cf073e36f00f3607bac2a84681e5..8bc858104ea946b8a2b88b438736fa710ab92509 100644 (file)
Binary files a/gpsbabel/gui/gpsbabelfe_es.qm and b/gpsbabel/gui/gpsbabelfe_es.qm differ
index ce06aba78640782153160719d643558f88994fc8..69663a79d5a9fcb6a7f866f89facf38123bdc52f 100644 (file)
Binary files a/gpsbabel/gui/gpsbabelfe_it.qm and b/gpsbabel/gui/gpsbabelfe_it.qm differ
index 9dab25d7c5f2b7d941d72c577b87aa47be1002bd..af1b5abd0ad7dabf61a538d2dc2956480a2b5109 100644 (file)
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-// $Id: mainwindow.cpp,v 1.20 2010-04-12 02:53:03 robertl Exp $
+// $Id: mainwindow.cpp,v 1.21 2010-06-19 23:59:06 robertl Exp $
 //------------------------------------------------------------------------
 //
 //  Copyright (C) 2009  S. Khai Mong <khai@mangrai.com>.
 #include <QTextStream>
 
 #include "mainwindow.h"
+#include "../gbversion.h"
 #include "aboutdlg.h"
 #include "advdlg.h"
 #include "appname.h"
 #include "babeldata.h"
+#include "donate.h"
 #include "filterdlg.h"
 #include "formatload.h"
 #include "gmapdlg.h"
@@ -39,8 +41,8 @@
 #include "optionsdlg.h"
 #include "preferences.h"
 #include "processwait.h"
+#include "version_mismatch.h"
 #include "upgrade.h"
-#include "../gbversion.h"
 
 const int BabelData::noType = -1;
 const int BabelData::fileType = 0;
@@ -195,6 +197,13 @@ MainWindow::MainWindow(QWidget* parent): QMainWindow(parent)
     upgrade->checkForUpgrade(babelVersion, bd.upgradeCheckTime, 
                              allowBetaUpgrades());
   }
+
+  if (!bd.ignoreVersionMismatch && babelVersion != VERSION) {
+    VersionMismatch vm(0, babelVersion, QString(appName) + QString(" " VERSION));
+
+    vm.exec();
+    bd.ignoreVersionMismatch = vm.neverAgain();
+  }
 }
 
 //------------------------------------------------------------------------
@@ -915,6 +924,16 @@ void MainWindow::closeActionX()
   if (wt.isValid()) {
     bd.upgradeCheckTime = wt;
   }
+  bd.runCount++;
+
+  QDateTime now = QDateTime::currentDateTime();
+  if((bd.runCount > 5) && (bd.donateSplashed.daysTo(now) > 30)) {
+    Donate donate(0);
+    if (bd.donateSplashed.date() == QDate(2010,1,1))
+      donate.showNever(false);
+    donate.exec();
+    bd.donateSplashed = now;
+  }
   saveSettings();
   delete upgrade;
   upgrade = 0;
index 3d01dfd3c134264fd0ac2acad421c2c0e889e019..5366420e944724f06d231f85514c46904174372a 100644 (file)
@@ -40,6 +40,7 @@ Preferences::Preferences(QWidget* parent, QList<Format>& formatList,
 
   ui_.startupCheck->setChecked(bd_.startupVersionCheck);
   ui_.reportStatisticsCheck->setChecked(bd_.reportStatistics);
+  ui_.ignoreVersionMismatchCheck->setChecked(bd_.ignoreVersionMismatch);
 
   connect (ui_.buttonBox, SIGNAL(accepted()), this, SLOT(acceptClicked()));
   connect (ui_.buttonBox, SIGNAL(rejected()), this, SLOT(rejectClicked()));
@@ -79,6 +80,7 @@ void Preferences::acceptClicked()
 
   bd_.startupVersionCheck = ui_.startupCheck->isChecked();
   bd_.reportStatistics = ui_.reportStatisticsCheck->isChecked();
+  bd_.ignoreVersionMismatch = ui_.ignoreVersionMismatchCheck->isChecked();
   accept();
 }
 
index 9b24efa1a0fa1adc57489d6e1b21b1fe8ca4c058..d66a009c7e3d54fa072d982dfd44cab937cb417f 100644 (file)
@@ -6,8 +6,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>504</width>
-    <height>328</height>
+    <width>454</width>
+    <height>327</height>
    </rect>
   </property>
   <property name="sizePolicy">
@@ -34,8 +34,8 @@
         <rect>
          <x>23</x>
          <y>18</y>
-         <width>234</width>
-         <height>43</height>
+         <width>387</width>
+         <height>62</height>
         </rect>
        </property>
        <layout class="QVBoxLayout" name="verticalLayout_4">
           </property>
          </widget>
         </item>
+        <item>
+         <widget class="QCheckBox" name="ignoreVersionMismatchCheck">
+          <property name="text">
+           <string>Ignore mismatch between command line and GUI version.</string>
+          </property>
+         </widget>
+        </item>
        </layout>
       </widget>
      </widget>
          </item>
         </layout>
        </item>
-       <item>
-        <spacer name="horizontalSpacer">
-         <property name="orientation">
-          <enum>Qt::Horizontal</enum>
-         </property>
-         <property name="sizeHint" stdset="0">
-          <size>
-           <width>40</width>
-           <height>20</height>
-          </size>
-         </property>
-        </spacer>
-       </item>
       </layout>
      </widget>
     </widget>
index 26eb03e85a69f2f9482e5c649d406d0b1d5e226b..5b18e55fac925135311382a05b3ee261720743a0 100644 (file)
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-// $Id: upgrade.cpp,v 1.25 2010-04-12 02:53:04 robertl Exp $
+// $Id: upgrade.cpp,v 1.26 2010-06-19 23:59:06 robertl Exp $
 /*
     Copyright (C) 2009, 2010  Robert Lipe, robertlipe@gpsbabel.org
 
@@ -164,8 +164,10 @@ UpgradeCheck::updateStatus UpgradeCheck::checkForUpgrade(
   args += "&last_checkin=" + lastCheckTime.toString(Qt::ISODate);
   args += QString("&ugcb=%1").arg(bd_.upgradeCallbacks); 
   args += QString("&ugdec=%1").arg(bd_.upgradeDeclines); 
+  args += QString("&ugacc=%1").arg(bd_.upgradeAccept); 
   args += QString("&ugoff=%1").arg(bd_.upgradeOffers); 
   args += QString("&ugerr=%1").arg(bd_.upgradeErrors); 
+  args += QString("&rc=%1").arg(bd_.runCount); 
 
   int j = 0;
 
@@ -212,7 +214,6 @@ void UpgradeCheck::readResponseHeader(const QHttpResponseHeader &responseHeader)
 
 void UpgradeCheck::httpRequestFinished(int requestId, bool error)
 {
-  bd_.upgradeCallbacks++;
 
   if (http == 0 || error) {
     bd_.upgradeErrors++;
@@ -225,6 +226,7 @@ void UpgradeCheck::httpRequestFinished(int requestId, bool error)
     return;
   }
 
+  bd_.upgradeCallbacks++;
   QString oresponse(http->readAll());
 
   QDomDocument document;
@@ -287,8 +289,8 @@ void UpgradeCheck::httpRequestFinished(int requestId, bool error)
 
     information.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
     information.setDefaultButton(QMessageBox::Yes);
-
     information.setText(response);
+    
     information.setInformativeText(tr("Do you wish to download an upgrade?"));
     information.setDetailedText(upgradeText);
 
@@ -296,6 +298,8 @@ void UpgradeCheck::httpRequestFinished(int requestId, bool error)
       case QMessageBox::Yes:
         // downloadUrl.addQueryItem("os", getOsName());
         QDesktopServices::openUrl(downloadUrl);
+        bd_.upgradeAccept++;
+        break;
       default: ;
         bd_.upgradeDeclines++;
     }
diff --git a/gpsbabel/gui/version_mismatch.cpp b/gpsbabel/gui/version_mismatch.cpp
new file mode 100644 (file)
index 0000000..6256029
--- /dev/null
@@ -0,0 +1,34 @@
+// -*- C++ -*-
+//------------------------------------------------------------------------
+//
+//  Copyright (C) 2010  Robert Lipe <robertlipe@gpsbabel.org
+//
+//  This program is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU General Public License as
+//  published by the Free Software Foundation; either version 2 of the
+//  License, or (at your option) any later version.
+//
+//  This program is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  General Public License for more details.
+//
+//  You should have received a copy of the GNU General Public License
+//  along with this program; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111
+//  USA
+//
+
+#include "version_mismatch.h"
+
+VersionMismatch::VersionMismatch(QWidget *parent, const QString &ver1,
+                                 const QString &ver2): QDialog(parent)
+{
+  ui.setupUi(this);
+
+  ui.ClVersion->setText(ver1);
+  ui.ClVersion->adjustSize();
+
+  ui.GuiVersion->setText(ver2);
+  ui.GuiVersion->adjustSize();
+}
diff --git a/gpsbabel/gui/version_mismatch.h b/gpsbabel/gui/version_mismatch.h
new file mode 100644 (file)
index 0000000..2c88706
--- /dev/null
@@ -0,0 +1,39 @@
+// -*- C++ -*-
+//------------------------------------------------------------------------
+//
+//  Copyright (C) 2010  Robert Lipe <robertlipe@gpsbabel.org>
+//
+//  This program is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU General Public License as
+//  published by the Free Software Foundation; either version 2 of the
+//  License, or (at your option) any later version.
+//
+//  This program is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  General Public License for more details.
+//
+//  You should have received a copy of the GNU General Public License
+//  along with this program; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111
+//  USA
+//
+
+#ifndef VERSION_MISMATCH_H
+#define VERSION_MISMATCH_H
+
+#include <QDialog>
+
+#include "ui_version_mismatch.h"
+
+class VersionMismatch: public QDialog {
+ public:
+  VersionMismatch(QWidget *parent,  const QString &ver1,
+                 const QString &ver2);
+  bool neverAgain() { return ui.neverAgain->isChecked(); }
+
+ private:
+  Ui_VersionMismatch  ui;
+};
+
+#endif
diff --git a/gpsbabel/gui/version_mismatch.ui b/gpsbabel/gui/version_mismatch.ui
new file mode 100644 (file)
index 0000000..880aefd
--- /dev/null
@@ -0,0 +1,168 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>VersionMismatch</class>
+ <widget class="QDialog" name="VersionMismatch">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>346</width>
+    <height>144</height>
+   </rect>
+  </property>
+  <property name="sizePolicy">
+   <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
+    <horstretch>0</horstretch>
+    <verstretch>0</verstretch>
+   </sizepolicy>
+  </property>
+  <property name="minimumSize">
+   <size>
+    <width>0</width>
+    <height>0</height>
+   </size>
+  </property>
+  <property name="maximumSize">
+   <size>
+    <width>400</width>
+    <height>300</height>
+   </size>
+  </property>
+  <property name="windowTitle">
+   <string>GPSBabel Version Mismatch</string>
+  </property>
+  <layout class="QVBoxLayout" name="verticalLayout">
+   <item>
+    <widget class="QLabel" name="label">
+     <property name="text">
+      <string>&lt;b&gt;A version mismatch has been detected.&lt;/b&gt;</string>
+     </property>
+    </widget>
+   </item>
+   <item>
+    <layout class="QHBoxLayout" name="horizontalLayout">
+     <item>
+      <widget class="QLabel" name="label_2">
+       <property name="text">
+        <string>GPSBabel command line version:</string>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="QLabel" name="ClVersion">
+       <property name="toolTip">
+        <string notr="true" extracomment="Will be replaced by a versio nnumber at runtime.  Do not translate."/>
+       </property>
+       <property name="text">
+        <string/>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <spacer name="horizontalSpacer">
+       <property name="orientation">
+        <enum>Qt::Horizontal</enum>
+       </property>
+       <property name="sizeHint" stdset="0">
+        <size>
+         <width>40</width>
+         <height>20</height>
+        </size>
+       </property>
+      </spacer>
+     </item>
+    </layout>
+   </item>
+   <item>
+    <layout class="QHBoxLayout" name="horizontalLayout_2">
+     <item>
+      <widget class="QLabel" name="label_3">
+       <property name="text">
+        <string>GPSBabel GUI version:</string>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="QLabel" name="GuiVersion">
+       <property name="toolTip">
+        <string extracomment="Will be replaced by a versio nnumber at runtime.  Do not translate."/>
+       </property>
+       <property name="text">
+        <string/>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <spacer name="horizontalSpacer_2">
+       <property name="orientation">
+        <enum>Qt::Horizontal</enum>
+       </property>
+       <property name="sizeHint" stdset="0">
+        <size>
+         <width>40</width>
+         <height>20</height>
+        </size>
+       </property>
+      </spacer>
+     </item>
+    </layout>
+   </item>
+   <item>
+    <layout class="QHBoxLayout" name="horizontalLayout_3">
+     <item>
+      <widget class="QCheckBox" name="neverAgain">
+       <property name="text">
+        <string>Never show this message again.</string>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="QDialogButtonBox" name="buttonBox">
+       <property name="orientation">
+        <enum>Qt::Horizontal</enum>
+       </property>
+       <property name="standardButtons">
+        <set>QDialogButtonBox::Ignore</set>
+       </property>
+      </widget>
+     </item>
+    </layout>
+   </item>
+  </layout>
+ </widget>
+ <resources/>
+ <connections>
+  <connection>
+   <sender>buttonBox</sender>
+   <signal>accepted()</signal>
+   <receiver>VersionMismatch</receiver>
+   <slot>accept()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>248</x>
+     <y>254</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>157</x>
+     <y>274</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>buttonBox</sender>
+   <signal>rejected()</signal>
+   <receiver>VersionMismatch</receiver>
+   <slot>reject()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>316</x>
+     <y>260</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>286</x>
+     <y>274</y>
+    </hint>
+   </hints>
+  </connection>
+ </connections>
+</ui>